<?php

/**
 * PHP Classes
 * Process Form Post Data
 * Example Form
 */

require_once("class_prepost.php");

if ($_SERVER['REQUEST_METHOD'] === 'POST')
{

	$a = new prepost();
	$a->load($_POST);
	$a->vEmail();
	$a->vPhone();
	$a->vAlpha("firstname");
	$a->vAlpha("lastname");

	print "<pre>"; print_r($a->errors()); print "</pre>"; /* Error Array */

}
?>
<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="UTF-8">
		<title>prepost example</title>
		<link rel="stylesheet" type="text/css" href="css/style.css">
	</head>
	<body>
		<form method="post" class="form">
			<label for="firstname">First Name</label>
			<input type="text" name="firstname" id="firstname" class="firstname" />
			<br />
			<label for="lastname">Last Name</label>
			<input type="text" name="lastname" id="lastname" class="lastname" />
			<br />
			<label for="email">Email</label>
			<input type="text" name="email" id="email" class="email" />
			<br />
			<label for="phone">Phone</label>
			<input type="text" name="phone" id="phone" class="phone" />
			<br />
			<label for="submit">&nbsp;</label>
			<input type="submit" name="submit" value="Submit" id="submit" />
		</form>
	</body>
</html>